-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python] Bug Fix - model_generic templates to have valid imports for polymorphism #20273
base: master
Are you sure you want to change the base?
Conversation
can you please add a test model to modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml (and then regenerate the samples twice) to cover the issue moving forward? |
@wing328 Updated with samples, thanks! |
@@ -1957,6 +1957,13 @@ components: | |||
properties: | |||
breed: | |||
type: string | |||
Hunting__Dog: | |||
allOf: | |||
- $ref: '#/components/schemas/Animal' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding the test
to fix the build failure, what about using a new schema called "Creature" (based on Animal) to replace Animal in this new test schema instead?
reusing Animal as parent causing build failure due to change in error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wing328 , sure 'Creature' also already exists, but I tried using that as the parent. If the build still fails I can create a whole new schema
Fixes #20272
Can validate using the repro spec provided in the issue.
@cbornet @tomplus @krjakbrjak @fa0311 @multani
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)